Conversation
|
With the new changes, this the code should never reach here with a null value. Personally, I believe checking for nullable values is generally a good practice and makes it obvious on the code that it should never we null. But maybe I'd replace the message for something that implies an error instead of an incorrect user action. |
|
@aacuevas That's a good point, I was writing the error message from the perspective before adding the other checks, which would have indicated incorrect user actions. I've updated the error message to indicate this is simply an error for it to be null, and not anything the user did. |
This PR is based on the changes made in #535, and goes a step further to ensure that the gain correction is non-null, throwing an explicit exception if it is ever null so that the error message is useful.
However, during testing it was noted that #535 actually made it difficult to test this PR. If the issue-505 branch is removed, then these modifications correctly handle the case initially described in the issue where the gain correction value could be null. Nominally though, there should never be a case in the Data* nodes where the serial number exists but the gain correction value is null, since that condition is explicitly tested for in the Configure* nodes.
Fixes #506